package org.bozo.im.common.utils;

import org.bozo.im.R;
import org.bozo.im.common.types.Presence;

public class PresenceUtils {
	
	public static int toImageId(Presence pPresence) {

		int lRes = 0;

		switch (pPresence) {
		case AWAY:
			lRes = R.drawable.presence_away;
			break;
		case BUSY:
			lRes = R.drawable.presence_busy;
			break;
		case ONLINE:
			lRes = R.drawable.presence_online;
			break;
		case OFFLINE:
			lRes = R.drawable.presence_offline;
			break;
		}

		return lRes;
	}

	public static int toLocalizationId(Presence pPresence) {

		int lRes = 0;

		switch (pPresence) {
		case ONLINE:
			lRes = R.string.presence_available;
			break;
		case AWAY:
			lRes = R.string.presence_away;
			break;
		case OFFLINE:
			lRes = R.string.presence_disconnected;
			break;
		case BUSY:
			lRes = R.string.presence_dnd;
			break;
		}

		return lRes;
	}

	public static int toSystemPresence(Presence pPresence) {
		
		int lRes = 0;
		
		switch (pPresence) {
		case AWAY:
			lRes = 2;
			break;
		case BUSY:
			lRes = 4;
			break;
		case OFFLINE:
			lRes = 0;
			break;
		case ONLINE:
			lRes = 5;
			break;
		}
		
		return lRes;
	}
}
